package lik.http;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;

public class HuaShuTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			HttpURLConnection hUrlConnection = (HttpURLConnection) new URL(
					"http://125.210.188.4:8080/tvportal/auth?params=hangzh-Tvportal,hz_stb_0101,1,1794257,10,0,38307195,0,3421910,").openConnection();
			hUrlConnection.setConnectTimeout(1000);
			hUrlConnection.setReadTimeout(2000);
			BufferedReader bReader = new BufferedReader(new InputStreamReader(
					(InputStream) hUrlConnection.getContent()));
			StringBuilder sBuilder = new StringBuilder();
			while (bReader.ready()) {
				sBuilder.append(bReader.readLine());
			}
			bReader.close();
			if (sBuilder.toString().indexOf("rtsp") > -1) {
				System.out.println("===========");
			}
			String playUrl = sBuilder.toString().split("playUrl")[1].split("\"")[1];
			System.out.println(playUrl);
			sBuilder.delete(0, sBuilder.length());
			System.out.println(false & true);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
